package com.turing.post.salesmanage.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 充值单业务接口
 * 
 * @author zxp
 * @Jan 17, 2013
 */
@Remote
@Local
public interface DepositOrderDao {
	/**
	 * 根据充值单编号主键查询充值单
	 * 
	 * @param DepositOrderId
	 *            充值单编号
	 * @return 充值单
	 */
	public DepositOrder getDepositOrderByDepositOrderId(
			BigInteger depositOrderId);

	/**
	 * 根据充值单号查询充值单
	 * 
	 * @param saleOrderSeqNo
	 * @return
	 */
	public DepositOrder getDepositOrderBySaleOrderSeqNo(String saleOrderSeqNo);

	/**
	 * 查询锁定充值单
	 * 
	 * @param DepositOrderId
	 * @return
	 */
	public DepositOrder getDepositOrderForUpdate(BigInteger depositOrderId);

	/**
	 * 组合查询充值单
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return 充值单列表
	 */
	public List<DepositOrder> getDepositOrderListByCondition(
			PCPSWebInput webInput, String depositOrderId,
			String saleBranchNo, String depositType,
			BigInteger startSaleAmount, BigInteger endSaleAmount,
			String startTime, String endTime, String orderStatus,
			String btnStatus,String feeType, Integer page);

	/**
	 * 组合查询充值单
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @return 充值单记录数
	 */
	public BigInteger getDepositOrderTotalByCondition(PCPSWebInput webInput,
			String depositOrderId, String saleBranchNo, String depositType,
			BigInteger startSaleAmount, BigInteger endSaleAmount,
			String startTime, String endTime, String orderStatus,
			String btnStatus,String feeType);

	/**
	 * 新增
	 * 
	 * @param DepositOrder
	 * @throws PCPSApplicationException
	 */
	public void insertDepositOrder(DepositOrder depositOrder)
			throws PCPSApplicationException;

	/**
	 * 修改
	 * 
	 * @param DepositOrder
	 * @throws PCPSApplicationException
	 */
	public void updateDepositOrder(DepositOrder depositOrder)
			throws PCPSApplicationException;

	/**
	 * 卡-4.1 充值统计表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getCardBatchDepositReportByCondition(
			PCPSWebInput webInput, String saleBranchNo, String startTime,
			String endTime);

	/**
	 * 卡-4.2 充值明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getCardBatchDepositDetailReportByCondition(
			PCPSWebInput webInput, String branchNo, String startTime,
			String endTime);

	public List<DepositOrder> getDepositOrderListByVoucherNo(String voucherNo);

	/**
	 * 组合查询充值单Sum
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return 充值单列表
	 */
	public Object[] getDepositOrderListByConditionSum(PCPSWebInput webInput,
			String depositOrderId, String saleBranchNo, String depositType,
			BigInteger startSaleAmount, BigInteger endSaleAmount,
			String startTime, String endTime, String orderStatus,
			String btnStatus,String feeType);

	/**
	 * 获取某发卡机构下属销售机构某日充值单手续费总和
	 * 
	 * @param saleBrchNos
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public BigInteger getDepositOrderFactFeeBySaleBrchNos(String saleBrchNos,
			String startDate, String endDate);

}